<extend name="Public/main" />
<block name="body">
	<div class="wrap J_check_wrap">
		<div class="nav">
			<ul class="cc">
				<li class="current"><a href="javascript:;">所有文章</a><a href="{:U('post/lists',array('term'=>$term['term_id']))}">{$term.name}</a></li>
				<li><a href="{:U('post/add',array('term'=>$term['term_id']))}">添加文章</a></li>
			</ul>
		</div>
		<div class="mb10">
			<a href="{:U('post/add',array('term'=>$term['term_id']))}" target="_blank" class="btn" title="添加内容"><span class="add"></span>添加内容</a>
		</div>
		<div class="h_a">搜索</div>
		<form  method="post">
			<div class="search_type cc mb10">
				<div class="mb10"> 
					<span class="mr20">时间：
						<input type="text" name="start_time" class="input length_2 J_date" value="{$formget.start_time}" style="width:80px;" autocomplete="off">-<input type="text" class="input length_2 J_date" name="end_time" value="{$formget.end_time}" style="width:80px;" autocomplete="off">
						<select class="select_2" name="posids"style="width:70px;">
							<option value='' selected>全部</option>
						</select>
						<select class="select_2" name="searchtype" style="width:70px;">
							<option value='0' >标题</option>
						</select>
						关键字：
						<input type="text" class="input length_2" name="keyword" style="width:200px;" value="{$formget.keyword}" placeholder="请输入关键字...">
						<input type="submit" class="btn" value="搜索"/>
					</span>
				</div>
			</div>
		</form>
		<form class="J_ajaxForm" action="" method="post">
			<div class="table_list">
				<table width="100%">
					<colgroup>
						<col width="16">
						<col width="50">
						<col width="40">
						<col width="">
						<col width="80">
						<col width="90">
						<col width="140">
						<col width="120">
					</colgroup>
					<thead>
						<tr>
							<td><label><input type="checkbox" class="J_check_all" data-direction="x" data-checklist="J_check_x"></label></td>
							<td>排序</td>
							<td>ID</td>
							<td>标题</td>
							<td>点击量</td>
							<td>发布人</td>
							<td><span>发布时间</span></td>
							<td>状态</td>
							<td>操作</td>
						</tr>
					</thead>
					<php>$status=array("1"=>"已审核","0"=>"未审核");</php>
					<foreach name="posts" item="vo">
						<tr>
							<td><input type="checkbox" class="J_check" data-yid="J_check_y" data-xid="J_check_x" name="ids[]" value="{$vo.tid}" ></td>
							<td><input name='listorders[{$vo.tid}]' class="input mr5"  type='text' size='3' value='{$vo.listorder}'></td>
							<td><a>{$vo.tid}</a></td>
							<td><a target="_blank">
									<span style="" >{$vo.post_title}</span></a>
							</td>
							<td>0</td>
							<td>admin</td>
							<td>{$vo.post_date}</td>
							<td>{$status[$vo['post_status']]}</td>
							<td>
								<a href="{:U('post/edit',array('term'=>$term['term_id'],'id'=>$vo[ID]))}" target="_blank" >修改</a>|
								<a href="{:U('post/delete',array('term'=>$term['term_id'],'tid'=>$vo[tid]))}" class="J_ajax_del" >删除</a>
							</td>
						</tr>
					</foreach>
				</table>
				<div class="p10"><div class="pages"> {$Page} </div> </div>

			</div>
			<div>
				<div class="btn_wrap_pd">
					<label class="mr20"><input type="checkbox" class="J_check_all" data-direction="y" data-checklist="J_check_y">全选</label>                
					<button class="btn J_ajax_submit_btn" type="submit" data-action="{:u('post/listorders')}">排序</button>
					<button class="btn J_ajax_submit_btn" type="submit" data-action="{:u('post/check',array('check'=>1))}" data-subcheck="true" >审核</button>
					<button class="btn J_ajax_submit_btn" type="submit" data-action="{:u('post/check',array('uncheck'=>1))}" data-subcheck="true" >取消审核</button>
					<button class="btn J_ajax_submit_btn" type="submit" data-action="{:u('post/delete')}" data-subcheck="true" data-msg="你确定删除吗？">删除</button>
					<button class="btn" type="button" id="J_Content_remove">批量移动</button>
				</div>
			</div>
		</form>
	</div>
</block>

<block name="script">
	<script>

		function refersh_window() {
			var refersh_time = getCookie('refersh_time');
			if (refersh_time == 1) {
				window.location.reload();
			}
		}
		setInterval(function() {
			refersh_window();
		}, 2000);
		$(function() {
			setCookie("refersh_time", 0);
			Wind.use('ajaxForm', 'artDialog', 'iframeTools', function() {
				//批量移动
				$('#J_Content_remove').click(function(e) {
					var str = 0;
					var id = tag = '';
					$("input[name='ids[]']").each(function() {
						if ($(this).attr('checked')) {
							str = 1;
							id += tag + $(this).val();
							tag = ',';
						}
					});
					if (str == 0) {
						art.dialog.through({
							id: 'error',
							icon: 'error',
							content: '您没有勾选信息，无法进行操作！',
							cancelVal: '关闭',
							cancel: true
						});
						return false;
					}
					var $this = $(this);
					art.dialog.open("{:u('post/move')}&ids=" + id, {
						title: "批量移动"
					});
				});
			});
		});

	</script>
</block>